//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Common Core Extensions
//===============================================================================

using System;
using System.ComponentModel;

namespace EntLibContrib.Common.Configuration.Design
{
	/// <summary>
	/// Abstract file resource name type to hold the two string components that make up a file resource name
	/// </summary>
	/// <remarks>A file resource name is the combination of a path name and a resource base name.</remarks>
	public abstract class FileResourceName : ResourceName, IFileResourceName
	{
		#region Fields
		private string pathName;
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the path name.
		/// </summary>
		/// <value>The path name.</value>
		[ReadOnly(true)]
		[CommonDescription("ResourcePathNameDescription")]
		public string PathName
		{
			get
			{
				return this.pathName;
			}
			set
			{
				if (!String.IsNullOrEmpty(value))
					this.pathName = value.Trim();
			}
		}
		#endregion
			
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="FileResourceName"/> class.
		/// </summary>
		protected FileResourceName() : this (String.Empty, String.Empty)
		{
		}
			
		/// <summary>
		/// Initializes a new instance of the <see cref="FileResourceName"/> class.
		/// </summary>
		/// <param name="pathName">the file resource path.</param>
		/// <param name="baseName">the resource base name.</param>
		protected FileResourceName(string pathName, string baseName)
			: base(baseName)
		{
			this.pathName = pathName;
		}
		#endregion
	}
}
